{include file='common/head'}
<style>
    .imgs{width:80px;height: 80px;margin-left:10px}
</style>
<body>
<div class="x-body">
    <form class="layui-form" method="post"  enctype="multipart/form-data" action="">
        <input type="hidden" name="tid" value="{$updateOld.tid}">
        <div class="layui-form-item">
            <label class="layui-form-label">支付类型</label>
            <div class="layui-input-inline">
                <select name="zid">
                    {volist name='ztype' id='ztype'}
                    <option value="{$ztype.zid}" {if $updateOld.zid==$ztype.zid} selected {/if}>{$ztype.z_type}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付金额</label>
            <div class="layui-input-inline">
                <input type="text" name="t_money"  autocomplete="off" class="layui-input" value="{$updateOld.t_money}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="sub" lay-submit="" >
                确认
            </button>
        </div>
    </form>
</div>

<script src="__STATIC__/lib/layui/layui.js"></script>
<script src="__STATIC__/js/jquery-3.3.1.min.js"></script>
<script>
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;
        //监听提交
        form.on('submit(sub)', function(data){
            $.ajax({
                type: "post",
                async:false,
                url: "{:url('admin/indent/update')}",
                data: data.field,
                success:function(msg){
                    if(msg==1){
                        layer.msg(msg.msg,{icon:1,time:2000});
                        //发异步，把数据提交给php
                        layer.alert("修改成功", {icon: 6},function () {
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name);
                            //关闭当前frame
                            parent.layer.close(index);
                        });
                        window.parent.location.reload();//刷新父级窗口
                    }else{
                        layer.msg(msg.msg,{icon:1,time:1000});
                    }
                }
            })
            return false;
        });
    });
</script>

</body>

</html>